//
//  FKChooseCityCell.m
//  WanTao
//
//  Created by Macbook Pro on 2019/3/18.
//  Copyright © 2019 Macbook Pro. All rights reserved.
//

#import "FKChooseCityCell.h"

@interface FKChooseCityCell ()

@property (nonatomic, weak) UILabel *titleLabel;

@end

@implementation FKChooseCityCell

- (void)setupSubviews
{
    [super setupSubviews];
    self.contentView.backgroundColor = [UIColor fk_colorWithHex:0xF5F5F5];
    [self.contentView fk_viewCornerRadius:fk_adjustW(15) borderWidth:0 borderColor:nil];
    
    UILabel *titleLabel = [UILabel fk_labelWithFont:fk_adjustFont(14) textColor:fkColor333333 textAlignment:NSTextAlignmentCenter];
    [self addSubview:titleLabel];
    self.titleLabel = titleLabel;
    
    [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.offset(0);
    }];
}

- (void)setData:(id)data
{
    [super setData:data];
    
    if ([data isKindOfClass:[NSDictionary class]]) {
        self.titleLabel.text = data[@"title"];
    }
}

- (void)setSelected:(BOOL)selected
{
    [super setSelected:selected];
    
    if (selected) {
        self.titleLabel.textColor = [UIColor whiteColor];
        self.contentView.backgroundColor = fkMainColor;
    } else {
        self.titleLabel.textColor = fkColor333333;
        self.contentView.backgroundColor = [UIColor fk_colorWithHex:0xF5F5F5];
    }
}

@end
